#include <string.h>
#include "sort.h"

int big_data_cmp(char *a, char *b)
{
    if(*a == '-'){
        if(*b == '-'){
            if(strlen(a+1) > strlen(b+1)){
                return -1;
            }else if(strlen(a+1) < strlen(b+1)){
                return 1;
            }else{
                if(strcmp(a+1, b+1) < 0){
                    return 1;
                }else if(strcmp(a+1, b+1) > 0){
                    return -1;
                }
            }
        }else{
            return -1;
        }
    }else{
        if(*b == '-'){
            return 1;
        }else{
            if(strlen(a) > strlen(b)){
                return 1;
            }else if(strlen(a) < strlen(b)){
                return -1;
            }else{
                return strcmp(a, b);
            }
        }
    }
    return 0;
}

void swap_big_date(STR_NUM **nums, int i, int j)
{
    STR_NUM *tmp;
    tmp = nums[i];
    nums[i] = nums[j];
    nums[j] = tmp;
	return;
}

